<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 300px;
            margin: 50px;
            border: 1px solid #ddd;
        }
        .box ul{
            list-style: none;
        }
        .box ul li{
            padding: 5px;
        }
        .box ul li span{
            margin: 0 10px;
        }
        .current{
            background-color: #ccc !important;
        }
    </style>
    <script>
        window.onload = function(){
            var lis = document.getElementsByTagName("li");

            for(i=0,len=lis.length;i<len;i++)
            {
                if(i % 2 == 0){
                    lis[i].style.background = "#eee";
                }
                else{
                    lis[i].style.background = "#ddd";
                }

                lis[i].onmouseover = function(){
                    this.className = "current";
                }
                lis[i].onmouseout = function(){
                    this.className = "";
                }
            }
        }
    </script>
</head>
<body>
    <div class="box">
        <ul>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
            <li>
                <span>上证指数</span><span>3641</span><span>10-5</span><span>0.16%</span>
            </li>
        </ul>
    </div>
</body>
</html>